#!/usr/bin/python
#coding:utf8
'''
Visitor
'''
class Novel:
    def __init__(self, name):
        self.name = name
    def accept(self, visitor):
        pass
class FairyTales(Novel):
    def accept(self, visitor):
        visitor.visitFairy(self)

class Chivalry(Novel):
    def accept(self, visitor):
        visitor.visitChivalry(self)

class Children:
    def __init__(self,name):
        self.name = name
    def visitFairy(self, novel):
        print(f"欢迎{self.name}来到《{novel.name}》！")
    def visitChivalry(self, novel):
        print(f"欢迎{self.name}，《{novel.name}》可能不适合你，推荐访问童话故事！")

if __name__ == '__main__':
    novel1 = FairyTales('白雪公主')
    novel2 = Chivalry('倚天屠龙记')
    child = Children('小明')
    novel1.accept(child)
    novel2.accept(child)
